import { Component } from 'react';
import { Card, Row, Col } from 'antd';
import { isBindInfo } from '@/utils';

class AdministratorInfo extends Component {

  render() {
    const {
      headStyle,
      renderField,
      changedInformation,
      changedImg,
      userStatus,
    } = this.props;

    return (
      <Card
        title="管理员信息"
        headStyle={headStyle}
        style={{ marginBottom: '20px' }}
      >
        <Row>
          <Col span={10}>
            <div>姓名：<span style={{ marginRight: 15,  }}>{renderField('createBy')}</span>
                {isBindInfo(parseInt(userStatus, 0), false)}
            </div>
          </Col>
          <Col span={12}>
            <div>
              授权书：
              {renderField('authorizationIdInfo', val => val) && (
                <a
                  style={changedInformation.authorizationIdInfo ? changedImg : null}
                  href={renderField('authorizationIdInfo', val => val).url}
                >
                  下载
                </a>
              )}
            </div>
          </Col>
        </Row>
      </Card>
    );
  }
}

export default AdministratorInfo;
